Skip to content

Conversation

@camilleislasse
Copy link
Contributor

  • BaseTransport: Accept ?LoggerInterface parameter and convert null to NullLogger
  • StdioTransport: Change logger parameter to nullable
  • StreamableHttpTransport: Change logger parameter to nullable
  • InMemoryTransport: Fix missing parent::__construct() call and add logging

Motivation and Context

Allow passing null as logger parameter to avoid verbose ternary operators when the logger is optional.

How Has This Been Tested?

  • PHPUnit: All unit tests pass
  • PHP-CS-Fixer: Clean
  • PHPStan: No errors

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

https://github.com/camilleislasse/ai/blob/ecea6d676b4ea9e35ade883bda281ef1d113879d/src/mcp-bundle/src/Controller/McpController.php

@chr-hertel
Copy link
Member

@camilleislasse can you please sign your commit?

- BaseTransport: Accept ?LoggerInterface parameter and convert null to NullLogger
- StdioTransport: Change logger parameter to nullable
- StreamableHttpTransport: Change logger parameter to nullable
- InMemoryTransport: Fix missing parent::__construct() call and add logging
@camilleislasse camilleislasse force-pushed the feature/nullable-logger-in-transports branch from 8991ff0 to f7d6fee Compare November 20, 2025 18:41
@chr-hertel chr-hertel merged commit 470237a into modelcontextprotocol:main Nov 20, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants